/*
 * @Date: 2021-04-02 11:48:24
 * @LastEditors: Lzx
 * @FilePath: /web-vue/src/main.js
 * @Desc:
 */
import Vue from "vue";
import Vuex from "vuex";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "element-ui/lib/theme-chalk/base.css";
import Moment from "moment"; //日期格式化插件
import * as echarts from "echarts";
import CKEditor from "ckeditor4-vue"; // 富文本编辑器

import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/css/common.css";
// 导入后台API
import api from "./api/system";
import api2 from "./api/business";

Vue.prototype.$moment = Moment; //赋值使用
Vue.config.productionTip = false;
Vue.use(ElementUI);
Vue.use(CKEditor);
Vue.use(Vuex);
// Vue 自定义原型对象
Vue.prototype.$echarts = echarts;
Vue.prototype.$api = { ...api, ...api2};

// 定义全局时间戳过滤器
Vue.filter("formatDate", function (value) {
  return Moment(value).format("YYYY-MM-DD HH:mm:ss");
});

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

// collapse 展开折叠
import CollapseTransition from "element-ui/lib/transitions/collapse-transition";
Vue.component(CollapseTransition.name, CollapseTransition);
